<div class="componentheading"><?php echo $page_title;?></div>
<div class="box-header">Report to be generated Lists:</div>
<table width="100%">
	<thead>
          <tr>
               <td>
               		<form id="PublicationForm" method="post" action="<?php echo site_url('report/publicationList/');?>">
                    	<div style="float:left; padding-right:10px;">
                    	<select name="category_id" id="category_id" class="required" style="width:300px;">
                        	<option value="all">All Thematic Areas</option>
							<?php foreach($categories as $category) :?>
                                <option value="<?php echo $category->id;?>"><?php echo $category->category_name;?></option>
                            <?php endforeach; ?>
                        </select>
                        </div>
                        <div style="padding-top:10px;">
                        	<input type="checkbox" name="uncheck_quantity" value="1" checked="checked" />Include Quantities
                            <a href="javascript:;" class="submit_link">&gt;&gt;Generate Publication list&lt;&lt;</a>
                        </div>
               			
                    </form>
               </td>
          </tr>
          <tr>
               <td>
                   <form target="_blank" id="PublicationFormPDF" method="get" action="<?php echo base_url()."tcpdf/examples/tcpdf_publication.php";?>">
                    	<div style="float:left; padding-right:10px;">
                    	<select name="id" id="category_id_PDF" class="required" style="width:300px;">
                        	<option value="all">All Thematic Areas</option>
							<?php foreach($categories as $category) :?>
                                <option value="<?php echo $category->id;?>"><?php echo $category->category_name;?></option>
                            <?php endforeach; ?>
                        </select>
                        <input type="hidden" name="type" value="thematic">
                         </div>
                        <div style="padding-top:10px;">
                            <input type="submit" value="Generate Publication PDF list">
                        </div>

                    </form>
               </td>
          </tr>
          <tr>
          	<td>
                <form id="borrowerForm" method="post" action="<?php echo site_url('report/borrowerList');?>">
                	<span>Select Date</span>
                    <span>From: </span>
                    <input type="text" id="borrow_date_from" class="date_pick" name="date_from" value="<?php echo date('Y-m-d', mktime(0, 0, 0, date('m')-1, date('d'), date('Y')));?>" readonly="readonly" style="width:150px;" />
                    <span>To: </span>
                    <input type="text" id="borrow_date_to" class="date_pick" name="date_to" value="<?php echo date('Y-m-d');?>" readonly="readonly" style="width:150px;" />
                    <a href="javascript:;" class="submit_link">Generate Borrower list</a>
                </form>
            </td>
          </tr>
          <tr>
          	<td>
                <form id="MemberForm" method="post" action="<?php echo site_url('report/memberList');?>">
                	<input type="hidden" name="generate_members_list" value="1" />
                    <a href="javascript:;" class="submit_link">&gt;&gt;Generate Members list&lt;&lt;</a>
                </form>
            </td>
          </tr>
    </thead>
</table>
<script type="text/javascript">
$(document).ready(function(){
	$(".date_pick").datepicker({dateFormat:"yy-mm-dd"});						   
						   
	$('#borrowerForm a.submit_link').click(function(){
		$('#borrowerForm').submit();
	});
	
	$('#PublicationForm a.submit_link').click(function(){
		$('#PublicationForm').submit();
	});
	
	$('#MemberForm a.submit_link').click(function(){
		$('#MemberForm').submit();
	});
	$('#PublicationFormPDF a.submit_link_PDF').click(function(){
		$('#PublicationFormPDF').submit();
	});
});
</script>